<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>tl-spb-blog-后台添加配置</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <script src="../lib/axios.js"></script>
    <script src="../lib/layui/layui.js" v="layui" e="layui"></script>
    <link rel="stylesheet" type="text/css" href="../lib/layui/css/layui.css" />
</head>
<style>
    input {
        color: darkorchid;
        font-weight: 700;
    }
    .tl-ops-web-waf-ip-form-span{
        margin-left: -15px;
        position: relative;
        top: 3px;
    }
</style>
<body>

    <div class="layui-form" lay-filter="tl-ops-web-waf-ip-form" id="tl-ops-web-waf-ip-form" style="padding: 20px 20px 0 0;">
        <div class="layui-form-item" style="display: none;">
            <label class="layui-form-label">ID</label>
            <div class="layui-input-block">
                <input type="text" name="id" id="id" placeholder="请输入ID" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否白名单</label>
            <div class="layui-input-block" id="tl-tips-white" onmouseleave="tl_mouse_leave_tips()"
                onmouseenter="tl_mouse_enter_tips('tl-tips-white','设置为白名单，改规则对应的ip将被过滤')">
                <input type="radio" name="white" class="layui-input" value="true"><span class="tl-ops-web-waf-ip-form-span">是</span>
                <input type="radio" name="white" class="layui-input" value="false"><span class="tl-ops-web-waf-ip-form-span" >否</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">生效域名</label>
            <div class="layui-input-block">
                <input type="text" name="host" id="host" maxlength="100" placeholder="请输入域名" autocomplete="off" class="layui-input"
                    onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('host','此WAF规则仅对匹配的域名生效')">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">ip匹配规则</label>
            <div class="layui-input-block">
                <input type="text" name="value" id="value" maxlength="100" placeholder="请输入ip正则过滤规则" autocomplete="off" class="layui-input" 
                    onmouseleave="tl_mouse_leave_tips()"
                    onmouseenter="tl_mouse_enter_tips('value','填写需要进行WAF过滤的正则匹配的值，一旦请求的ip被此规则正则匹配中，将会被过滤')">
            </div>
        </div>
        <div class="layui-form-item" id="tl-ops-web-waf-ip-form-service-view"></div>
        <script id="tl-ops-web-waf-ip-form-service-tpl" type="text/html">
            {{#  if(d.length === 0) { }}
            <label class="layui-form-label">生效服务</label>
            <div class="layui-input-block">
                <p style="line-height: 37px;">暂无服务</p>
            </div>
            {{#  } else { }}
            <label class="layui-form-label">服务</label>
            <div class="layui-input-block">
                <select name="service" lay-verify="tl-ops-web-waf-ip-form-service" id="tl-ops-web-waf-ip-form-service">
                    <option value="">请选择服务</option>
                {{#  layui.each(d, function(index, service){ }}
                    <option value="{{index}}">{{index}}</option>
                {{#  }); }}
                </select> 
            </div>
            {{#  } }}
        </script>

        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="tl-ops-web-waf-ip-form-submit" id="tl-ops-web-waf-ip-form-submit" value="确认">
        </div>
    </div>

    <script src="../lib/tl_ops_web_comm.js"></script>
    <script src="tl_ops_web_waf_ip_form.js"></script>
    <script>
        layui.use(['laytpl', 'form', 'layedit'], tl_ops_web_waf_ip_form_main);
    </script>
</body>

</html>